home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-29 | 1.5 KB | 42 lines | [TEXT/GEOL] |
- Item forwarded by TIM.SWIHART to CPLUS.BUGS
-
- Item 7909753 27-June-90 09:20PDT
-
- From: D0532 Aidea Systems, Don Park,PRT
-
- To: CPLUS.DEV$ C++ Interest List--Developers
- CPLUS.APPLE$ C++ Interest List--Apple Employees
-
- Sub: private member in union?
-
- Section 9.5 of the newly published Annotated C++ Reference Manual indicates
- that ordinary unions may have private members as well as function members.
- However, I found that following piece of code does not compile under MPW C++
- 3.1B1 translator and Zortech C++ 2.0 compiler:
-
- union u {
- private: // error: private in union declaration
- int a;
- public: // error: public in union declaration
- char * p;
- };
-
- Perhaps this feature was part of the AT&T C++ 2.1 upgrade. I am not sure what
- to believe. The C++ Reference Manual supplied with MPW C++ is desperatly vague
- and inaccurate. Its section 9.5 states that "a union may have member
- functions" in one place and later states that "a union may not have function
- members." I didn't realize there was a difference between member functions and
- function members.
-
- Does anyone know what the story is?
-
- Don Park
-
- P.S. If you are still trying to figure out which of the millions of C++ books
- are good, I recommend the following:
-
- 1. C++ Primer by Stanley Lippman (For examples and easy listening)
- 2. The Annotated C++ Reference Manual (For reference and good sleep)
- 3. The C++ Answer Book (For examples)
-
-